vfs: fs_context: fix up param length parsing in legacy_parse_param
authorJamie Hill-Daniel <jamie@hill-daniel.co.uk>
Tue, 18 Jan 2022 07:06:04 +0000 (08:06 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 18 Jan 2022 21:31:03 +0000 (21:31 +0000)
commit23d06301aa48f69a251f7383f9b437868acab9b7
treeaa8bf6eba9f215b0cf00efbaaec10f781392fc84
parent2f1fe3a9f2bb535cc2df1af8dab51c5ebf769d30
vfs: fs_context: fix up param length parsing in legacy_parse_param

Origin: https://git.kernel.org/linus/722d94847de29310e8aa03fcbdb41fc92c521756
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-0185

The "PAGE_SIZE - 2 - size" calculation in legacy_parse_param() is an
unsigned type so a large value of "size" results in a high positive
value instead of a negative value as expected.  Fix this by getting rid
of the subtraction.

Signed-off-by: Jamie Hill-Daniel <jamie@hill-daniel.co.uk>
Signed-off-by: William Liu <willsroot@protonmail.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name vfs-fs_context-fix-up-param-length-parsing-in-legacy.patch
fs/fs_context.c